'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0
'
' NAME: 
'
' AUTHOR: Hjagar , Power Solution S.A.
' DATE  : 22/10/2007
'
' COMMENT: 
'
'==========================================================================

Dim args, xmlIn, xmlOut, xslt, fso, f, fileNameIn, aFileNameIn, fileNameOut
Set args = WScript.Arguments

If args.Count > 0 Then
	fileNameIn = args.Item(0)
	aFileNameIn = Split(fileNameIn, "\")
	aFileNameIn(UBound(aFileNameIn)) = "schema.xml"
	fileNameOut = Join(aFileNameIn, "\")
	Set xml = CreateObject("Msxml2.DOMDocument")
	Set xslt = CreateObject("Msxml2.DOMDocument")
	xml.load(fileNameIn)
	xslt.load("propel.xsl")
	xmlOut = xml.transformNode(xslt)
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set f = fso.CreateTextFile(fileNameOut)
	f.Write xmlOut
	f.Close
	Set fso = Nothing
	Set xml = Nothing
	Set xslt = Nothing
Else
	WScript.Echo "Falta archivo de entrada"
End If 
 